import request from '@/utils/request'
import { baseURL } from '@/config'

export function getList(data) {
  return request({
    url: '/admin/employmentRecord/getList',
    method: 'post',
    data,
  })
}

export function getRecordsByEmpId(data) {
  return request({
    url: '/admin/employmentRecord/getRecordsByEmpId',
    method: 'post',
    data,
  })
}

export function getQueryList(data) {
  return request({
    url: '/admin/employmentRecord/getQueryList',
    method: 'post',
    data,
  })
}

export function bindingRelationship(data) {
  return request({
    url: '/admin/employmentRecord/bindingRelationship',
    method: 'post',
    data,
  })
}

export function doDismiss(data) {
  return request({
    url: '/admin/employmentRecord/doDismiss',
    method: 'post',
    data,
  })
}
export function getEmployedNums(params) {
  return request({
    url: '/admin/employee/getEmployedNums',
    method: 'get',
    params,
  })
}

export function getEmploymentAgeFilterNums(params) {
  return request({
    url: '/admin/employmentRecord/getEmploymentAgeFilterNums',
    method: 'get',
    params,
  })
}

export function getEmployeeHistoryWorkNum(params) {
  return request({
    url: '/admin/employmentRecord/getEmployeeHistoryWorkNum',
    method: 'get',
    params,
  })
}

export function getOne(params) {
  return request({
    url: '/admin/employmentRecord/getOne',
    method: 'get',
    params,
  })
}

export function getDismissedNums(params) {
  return request({
    url: '/admin/employee/getDismissedNums',
    method: 'get',
    params,
  })
}

export function exportTemplate() {
  window.location.href = baseURL + 'admin/employmentRecord/exportTemplate'
}

export function exportTemplateQuery() {
  window.location.href = baseURL + 'admin/employmentRecord/exportTemplateQuery'
}

export function exportTemplateDismiss() {
  window.location.href =
    baseURL + 'admin/employmentRecord/exportTemplateDismiss'
}

export function exportError(param) {
  window.location.href =
    baseURL +
    'admin/employmentRecord/exportError?errEmploymentRecordRedisId=' +
    param
}

export function getEmployeeInsureInfo(data) {
  return request({
    url: '/admin/employmentRecord/getEmployeeInsureInfo',
    method: 'post',
    data,
  })
}

export function doImport(data) {
  return request({
    url: '/admin/employmentRecord/doImport',
    method: 'post',
    data,
  })
}

export function doImportQuery(data) {
  return request({
    url: '/admin/employmentRecord/doImportQuery',
    method: 'post',
    data,
  })
}

export function doImportDismiss(data) {
  return request({
    url: '/admin/employmentRecord/doImportDismiss',
    method: 'post',
    data,
  })
}

export function doAddAll(data) {
  return request({
    url: '/admin/employmentRecord/doAddAll',
    method: 'post',
    data,
  })
}

export function doAddDismiss(data) {
  return request({
    url: '/admin/employmentRecord/doAddDismiss',
    method: 'post',
    data,
  })
}

export function exportQuery(param) {
  window.location.href =
    baseURL + 'admin/employmentRecord/exportQuery?queryKey=' + param
}

// export function executePdfOfHMC(data) {
//   return request({
//     url: '/public/executePdfOfHMC',
//     method: 'post',
//     data,
//   })
// }
export function executePdfOfHMC(params) {
  return request({
    url: 'public/executePdfOfHMC',
    method: 'get',
    params,
  })
}
